Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language Reference
Chapter 7 - Control Statements / If Statements


If (Simple Statement)

A simple If statement contains one Boolean expression and a statement to be executed if the value of the Boolean expression is true.

SYNTAX
if Boolean then statement 
where

Boolean is an expression whose value is true or false.

statement is any AppleScript statement.

EXAMPLES
In the following If statement

if result > 3 then display dialog "The result is " & ÿ   result as string
the Display Dialog command is executed only if the value of the Boolean expression result > 3 is true.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996